package usaco.c2010.january.bronze;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

/*
 * p3562
 * USACO 2010 January - Bronze
 */

public class p3562 {

	static int W, R;
	static int[][] score;
	static seat[] ss;

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		W = scanner.nextInt();
		R = scanner.nextInt();
		score = new int[R+1][W+1];
		
		ss = new seat[W*R];
		int ns = 0;
		for (int i=1;i<=R;++i) {
			for (int j=1;j<=W;++j) {
				ss[ns] = new seat(i,j,1,(W+1)/2);
				ns++;
			}
		}
		Arrays.sort(ss, new Comparator<seat>() {

			public int compare(seat s1, seat s2) {
				if (s1.dist == s2.dist) {
					if (s1.r == s2.r) {
						return s1.c - s2.c;
					}
					else {
						return s1.r - s2.r;
					}
				}
				else {
					return s1.dist - s2.dist;
				}
			}
			
		});
		
		for (int i=0;i<ns;++i) {
			score[ss[i].r][ss[i].c] = i + 1;
		}

		for (int i=R;i>=1;--i) {
			for (int j=1;j<=W;++j) {
				System.out.print(score[i][j]);
				if (j < W) {
					System.out.print(" ");
				}
				else {
					System.out.println();
				}
			}
		}
	}

}

class seat {
	int r, c, dist;
	seat (int r, int c, int cr, int cc) {
		this.r = r;
		this.c = c;
		this.dist = (this.r - cr)*(this.r - cr) + (this.c - cc)*(this.c - cc);
	}
}
